// The Swift Programming Language
// https://docs.swift.org/swift-book

/// A macro that produces both a value and a string containing the
/// source code that generated the value. For example,
///
///     #stringify(x + y)
///
/// produces a tuple `(x + y, "x + y")`.
@freestanding(expression)
public macro stringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "MyFirstMacroMacros", type: "StringifyMacro")


@freestanding(declaration, names: arbitrary)
public macro defineKeysMacro(_ keys: String...) = #externalMacro(module: "MyFirstMacroMacros", type: "DefineKeysMacro")

@attached(member, names: named(id))
public macro AddId() = #externalMacro(module: "MyFirstMacroMacros", type: "AddIdMacro")

@attached(member, names: named(init(from:)), named(CodingKeys))
public macro CodableSubclass() = #externalMacro(module: "MyFirstMacroMacros", type: "CodableSubclassMacro")
// TestBodyMacro
@attached(body)
public macro HelloBody() = #externalMacro(module: "MyFirstMacroMacros", type: "TestBodyMacro")

// DescriptionMacro
@attached(member, names: named(description))
public macro Description() = #externalMacro(module: "MyFirstMacroMacros", type: "DescriptionMacro")
